﻿using System.IO;
using IGS.Core.Logging;
using Moq;
using NUnit.Framework;

namespace IGS.Core.Tests.Logging
{
    public static class LoggingTests
    {
        [TestFixture]
        public class GivenLoggerWithInfoStream
        {
            [Test]
            public void WhenInfoMessageIsWrittenItShouldAppearOnInfoStream()
            {
                // Arrange
                var infoStream = new Mock<TextWriter>();
                var logger = new Logger(infoStream.Object);
                const string value = "Test";

                // Act
                logger.LogInfo(value);

                // Assert
                infoStream.Verify(s => s.WriteLine(value, new object[] {}));
            }
        }
    }
}
